<template>
  <div class="tags">
    <el-tag
      v-for="(item,index) in tags"
      :key="item.path"
      :closable="item.name != 'home'"
      :effect="route.name === item.name ? 'dark' : 'plain'"
      @click="handPath(item)"
    >
      {{ item.label }}
    </el-tag>
  </div>
</template>

<script setup>
import { computed, ref} from 'vue';
import {useRoute,useRouter} from 'vue-router'
import {useStore} from '@/stroes'
const store =useStore();
const tags =computed(()=>store.tags)

 const route = useRoute();
 const router = useRouter();

 const handPath= (val)=>{
  router.push(val.path);
  store.selectMenu(val);
 }
</script>

<style lang="less" scoped>
  .tags{
    margin: 20px 0 0 20px;
  }
  .el-tag{
    margin-right: 10px;
  }
</style>